<template>
  <div>
    <van-swipe :autoplay="3000">
       <van-swipe-item v-for="(image, index) in images" :key="index">
          <img v-lazy="image" @click="fun(index)" />
      </van-swipe-item>
   </van-swipe>    
  </div>
</template>

<script>
export default {
   data() {
    return {
      images: [
      require('../../../public/img/1.png'),
      require('../../../public/img/3.jpg'),
      require('../../../public/img/4.jpg'),
      require('../../../public/img/5.jpg')
      ],
    };
  },
  methods:{
  fun(index){
    console.log(index)
    // this.$router.push("/scrollinfo")
    this.$router.push({name:"Scrollinfo",query:{index:index}})
  }
  }
}
</script>

<style scoped>
.van-swipe{
  width:100%;
 overflow: hidden;
}
.van-swipe .van-swipe__track .van-swipe-item{
 float: left;
}

 .my-swipe .van-swipe-item{
    width: 100%;
    height: 1.23rem;
    /* flex-shrink: 0; */
  }
   img{
    display: inline-block;
    width: 100%;
    height: 1.23rem;
   
  }
</style>